using System;
using UnityEngine;

namespace TCG
{
    public class BaseBehaviour : MonoBehaviour
    {
        public new Animation animation
        {
            get 
            {
                if (m_cachedAnimation == null)
                {
                    m_cachedAnimation = base.animation;
                }
                return m_cachedAnimation;
            }
        }

        public new AudioSource audio
        {
            get
            {
                if (m_cachedAudio == null)
                {
                    m_cachedAudio = base.audio;
                }
                return m_cachedAudio;
            }
        }

        public new Camera camera
        {
            get
            {
                if (m_cachedCamera == null)
                {
                    m_cachedCamera = base.camera;
                }
                return m_cachedCamera;
            }
        }

        public new Collider collider
        {
            get
            {
                if (m_cachedCollider == null)
                {
                    m_cachedCollider = base.collider;
                }
                return m_cachedCollider;
            }
        }

        public new Renderer renderer
        {
            get
            {
                if (m_cachedRenderer == null)
                {
                    m_cachedRenderer = base.renderer;
                }
                return m_cachedRenderer;
            }
        }

        public new Transform transform
        {
            get
            {
                if (m_cachedTransform == null)
                {
                    m_cachedTransform = base.transform;
                }
                return m_cachedTransform;
            }
        }

        protected virtual void Awake ()
        {
            
            // tag method
        }

        protected virtual void Start ()
        {
            // tag method
        }

        protected virtual void Update ()
        {
            // tag method
        }

        protected virtual void OnDestroy ()
        {
            // tag method
        }

        Animation m_cachedAnimation = null;
        AudioSource m_cachedAudio = null;
        Camera m_cachedCamera = null;
        Collider m_cachedCollider = null;
        Renderer m_cachedRenderer = null;
        Transform m_cachedTransform = null;
    }
}

